//
//  DSPUserCount.swift
//  SWweibo
//
//  Created by 杜守鹏 on 15/12/30.
//  Copyright © 2015年 杜守鹏. All rights reserved.
//

import UIKit

class DSPUserCount: NSObject,NSCoding {
    //    "access_token" = "2.0062CGQG0NyFf386bb95b7b5clfwSB";
    //    "expires_in" = 157679999;
    //    "remind_in" = 157679999;
    //    uid = 5734657351;
    
    var access_token : String?
    var expires_in = 0.0
    var uid : String?
    var buildTime :NSDate?
    var avatar_large:String?
    var screen_name:String?
    
    init(dict:[String:AnyObject]){
        super.init()
        setValuesForKeysWithDictionary(dict)
    }
    
    override func setValue(value: AnyObject?, forUndefinedKey key: String) {
        
    }
    
    func encodeWithCoder(enCoder: NSCoder) {
        enCoder.encodeObject(access_token,forKey: "access_token")
        enCoder.encodeDouble(expires_in, forKey: "expires_in")
        enCoder.encodeObject(uid,forKey: "uid")
        enCoder.encodeObject(buildTime,forKey: "buildTime")
        enCoder.encodeObject(avatar_large,forKey: "avatar_large")
        enCoder.encodeObject(screen_name,forKey: "screen_name")
    }
    
    required init?(coder decoder: NSCoder) {
        access_token = decoder.decodeObjectForKey("access_token") as? String
        expires_in = decoder.decodeDoubleForKey("expires_in")
        uid = decoder.decodeObjectForKey("uid")as? String
        buildTime = decoder.decodeObjectForKey("buildTime")as? NSDate
        avatar_large = decoder.decodeObjectForKey("avatar_large")as? String
        screen_name = decoder.decodeObjectForKey("screen_name")as? String
    }
    
    override var description : String{
        let keys = ["access_token","expires_in","uid","uid"]
        return dictionaryWithValuesForKeys(keys).description
    }
}


